From 78563078edf12268f39298147a7517ee57c63ead Mon Sep 17 00:00:00 2001 From: Robert Lipe Date: Wed, 8 Feb 2023 00:49:28 -0600 Subject: [PATCH] Remove ltrtim(). No callers remain. --- defs.h | 1 - util.cc | 33 --------------------------------- 2 files changed, 34 deletions(-) diff --git a/defs.h b/defs.h index 25ef7fe91..495453cad 100644 --- a/defs.h +++ b/defs.h @@ -1019,7 +1019,6 @@ inline int case_ignore_strncmp(const QString& s1, const QString& s2, int n) int str_match(const char* str, const char* match); void rtrim(char* s); -char* lrtrim(char* buff); int xasprintf(char** strp, const char* fmt, ...) PRINTFLIKE(2, 3); int xasprintf(QString* strp, const char* fmt, ...) PRINTFLIKE(2, 3); int xasprintf(QScopedPointer& strp, const char* fmt, ...) PRINTFLIKE(2, 3); diff --git a/util.cc b/util.cc index 4819cdf11..a5bad5118 100644 --- a/util.cc +++ b/util.cc @@ -338,39 +338,6 @@ rtrim(char* s) } } -/* - * Like trim, but trims whitespace from both beginning and end. - */ -char* -lrtrim(char* buff) -{ - if (buff[0] == '\0') { - return buff; - } - - char* c = buff + strlen(buff); - while ((c >= buff) && ((unsigned char)*c <= ' ')) { - *c-- = '\0'; - } - - c = buff; - while ((*c != '\0') && ((unsigned char)*c <= ' ')) { - c++; - } - - if (c != buff) { - char* src = c; - char* dst = buff; - - while (*src) { - *dst++ = *src++; - } - *dst = '\0'; - } - - return buff; -} - /* * compare str with match * match may contain wildcards "*" and "?" -- 2.30.2